﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Calculator1
{
    class Program
    {
        static void Main(string[] args)
        {

                double firstNumber=0;
                double secondNumber=0;
                char function=' ';
                double result=0;
                Console.WriteLine("Input the first number:");
                firstNumber = double.Parse(Console.ReadLine());
                Console.WriteLine("Input the second number:");
                secondNumber = double.Parse(Console.ReadLine());
                Console.WriteLine("Input the function:");
                function = (char)Console.Read();
                switch (function)
                {
                    case '+':
                        result = firstNumber + secondNumber;
                        Console.WriteLine(result);
                        result = 0;
                        break;
                    case '-':
                        result = firstNumber - secondNumber;
                        Console.WriteLine(result);
                        result = 0;
                        break;
                    case '*':
                        result = firstNumber * secondNumber;
                        Console.WriteLine(result);
                        result = 0;
                        break;
                    case '/':
                        result = firstNumber / secondNumber;
                        Console.WriteLine(result);
                        result = 0;
                        break;
                    default:
                        Console.WriteLine("输入有误，请重新输入");
                        break;
                }
            Console.ReadLine();
            
        }
    }
}
